<template>
    <div>
      <el-table      
          highlight-current-row
        @selection-change="handleselectionchange"
      :data="tableData"
      border
      style="">
      <el-table-column
        prop="type"
        label="服务类型"
        width="250"
        align="center">
      </el-table-column>

      <el-table-column     
        label="操作"
        width="165"
        align="center">
        <p>操作</p>
        <!-- slot-scope="scope" -->
        <template slot-scope="scope"> 
          <el-button type="success" size="mini" @click="select(scope)">选择</el-button>
           
        </template>
      </el-table-column>
    </el-table>
    <el-button type="primary" @click="confirmtype()">确 定</el-button>
     <el-button type="warning" @click="cancel()">取消</el-button>
    </div>
</template>

<script>
export default {
         data() {
          return{
           current: {} ,  // 记录当前哪条数据被选中了
           tableData:[], 
           servicetype:{
            id:"",
            type:""
           }

      }
    },

    methods:{
        select:function(scope){
        this.servicetype=scope.row
        },
            cancel:function(){
         this.$emit("cancel",false)
        },
        confirmtype:function(){
             this.$emit("confirmtype",this.servicetype)
        }
    },
      mounted(){
      this.$axios.get("http://localhost:8080/type/findall").then(res =>{
        this.tableData = res.data.data
        
      })
    }
}
</script>

<style>
</style>